namespace OasisCiq.Xal
{
    using System;
    using System.Linq;
    
    /// <summary>
    /// A list of name element types for thoroughfare
    /// </summary>
    public class ThoroughfareNameTypeList : XS.XSNormalizedString
    {
        private static readonly string[] PossibleValues = new[]
        {
            "NameOnly", // Just the name part, such as Baker in Baker Street.
            "PreDirection", // North Archer Street, where "North" is PreDirection
            "PostDirection", // Archer Street North, where "North" is PostDirection
            "NameAndNumber", // This value indicates that the element contains the street name and street number. E.g. 39 Baker Street. Use this when you do not want to break the thoroughfare into atomic types
            "NameAndType", // Baker Street, where Baker is Name and Street is Type
            "NameNumberAndType", // 21 Archer Street (Full thoroughfare details)
            "Unstructured", // Full details of a thorughfare in a single line (unstructured) e.g. 39 Baker Street North
            "SubThoroughfareConnector", // When more than one street name is required to identify the location this type can be used to connect them with values such as CORNER OF or VIA.
            "ReferenceLocation", // Free text description of some other location and how this thoroughfare relates to it, e.g. 300m from water station, new the police station, etc.
            "Type" // Additional description like intersection, cross streets, etc
        };

        public ThoroughfareNameTypeList(string value)
            : base(value)
        {
            if (!PossibleValues.Contains(value))
            {
                throw new ArgumentOutOfRangeException();
            }
        }
    }
}